package com.muatocroi.tornado;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class PowerActivity extends ActivityMCAbstractClass implements OnClickListener {
	Button btnlogoff, btnlockPC, btnShutdown, btnRestart, btnHibernate, btnStandby;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_power);
		
		btnlogoff = (Button) findViewById(R.id.btnlogoff);
		btnlogoff.setOnClickListener(this);
		
		btnlockPC = (Button) findViewById(R.id.btnlockPC);
		btnlockPC.setOnClickListener(this);
		
		btnShutdown = (Button) findViewById(R.id.btnShutdown);
		btnShutdown.setOnClickListener(this);
		
		btnRestart = (Button) findViewById(R.id.btnRestart);
		btnRestart.setOnClickListener(this);
		
		btnHibernate = (Button) findViewById(R.id.btnHibernate);
		btnHibernate.setOnClickListener(this);
		
		btnStandby = (Button) findViewById(R.id.btnStandby);
		btnStandby.setOnClickListener(this);
		
		
		
	}
	@Override
	public void onClick(View v) {
		int id = v.getId();
		switch (id) {
		case R.id.btnlogoff:
			SignalSender.getSender().Send(CommandPower.LogOff());
			break;

		case R.id.btnlockPC:
			SignalSender.getSender().Send(CommandPower.LockPC());
			break;

		case R.id.btnShutdown:
			SignalSender.getSender().Send(CommandPower.Shutdown());
			break;

		case R.id.btnRestart:
			SignalSender.getSender().Send(CommandPower.Restart());
			break;

		case R.id.btnHibernate:
			SignalSender.getSender().Send(CommandPower.Hibernate());
			break;

		case R.id.btnStandby:
			SignalSender.getSender().Send(CommandPower.Standby());
			break;
		default:
			break;
		}
	}


}
